/*
 * @Author: lyl 2289538564@qq.com
 * @Date: 2022-04-13 16:57:25
 * @LastEditors: CemCode cemoment@aliyun.com
 * @LastEditTime: 2022-07-10 14:53:46
 * @FilePath: \vue-blog-2\src\api\admin\index.js
 * @Description: 接口
 */

import request from '../../utils/request'

// 登录接口
export const $login = params=>{
    return request.post("/admin/api/login",params)
}

// 获取博客被访问的次数信息
export const $request = params=>{
    return request.get(`/admin/api/request`,{params})
}

// 获取服务器平台信息
export const $server = ()=>{
    return request.get("/admin/api/server_info")
}

// 获取主题配置信息
export const $theme = ()=> request.get("/public/api/theme_info")

// 提交主题配置信息
export const $updateTheme = params=> request.post("/admin/api/update_theme_info",params)

// 获取文章标签信息
export const $articleLabels = params => request.get("/article_manage/api/labels",{params})

// 获取文章类型信息
export const $articleTypes = () => request.get("/article_manage/api/types")

// 获取文章列表
export const $articleList = params => request.get(`/article_manage/api/getArticleList`,{params})

// 删除指定文章
export const $delArticle = params => request.post("/article_manage/api/delArticle",params)

// 提交文章内容
export const $addArticle = params => request.post("/article_manage/api/addArticle",params)

// 修改文章内容
export const $updateArticle = params => request.post("/article_manage/api/updateArticle",params)

// 修改公告内容
export const $updateNotice = params => request.post("/admin/api/update_notice",params)
 
// 新增标签
export const $addLabel = params => request.post("/article_manage/api/addLabel",params)

// 修改标签
export const $updateLabel = params => request.post("/article_manage/api/updateLabel",params)

// 删除标签
export const $delLabel = params => request.post("/article_manage/api/delLabel",params)

// 新增类型
export const $addType = params => request.post("/article_manage/api/addType",params)

// 修改类型
export const $updateType = params => request.post("/article_manage/api/updateType",params)

// 删除类型
export const $delType = params => request.post("/article_manage/api/delType",params)